package com.googlecode.objectify.hbase;

import fi.aalto.hacid.HAcidTable;
import java.io.IOException;
import lombok.Delegate;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.hadoop.hbase.util.Bytes;

/**
 *
 * @author mjaggard
 */
public class HAcidHTable extends HAcidTable implements HTableInterface
{

	@Delegate
	private final HTable htableDelegate;

	public HAcidHTable(final String tableName) throws IOException
	{
		this(HBaseConfiguration.create(), Bytes.toBytes(tableName));
	}

	public HAcidHTable(final byte[] tableName) throws IOException
	{
		this(HBaseConfiguration.create(), tableName);
	}

	public HAcidHTable(Configuration conf, final String tableName) throws IOException
	{
		this(conf, Bytes.toBytes(tableName));
	}

	public HAcidHTable(Configuration conf, final byte[] tableName) throws IOException
	{
		super(conf, tableName);
		htableDelegate = htable;
	}
}
